<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增发货记录')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-sossend-add" th:object="${sos}">
            <input id="id" name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">发货数量：</label>
                <div class="col-sm-8">
                    <input id="sendqty" name="sendqty" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发货物流号：</label>
                <div class="col-sm-8">
                    <input id="logcode" name="logcode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input id="smemo" name="smemo" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "erp/sossend"
        $("#form-sossend-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            /*if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-sossend-add').serialize());
            }*/
            $.ajax({
                type: "post",
                url: prefix + "/add?id="+$("#id").val()+"&sendqty="+$("#sendqty").val()+"&logcode="+$("#logcode").val()+"&smemo="+$("#smemo").val(),
                success: function(r) {
                    debugger;
                    if(r.code == 500){
                        setTimeout($.modal.msgError(r.msg),2000);
                    }else{
                        $.modal.msgSuccess("添加成功");
                        setTimeout($.modal.reload(),1000);
                    }

                }
            });
            $.modal.reload();
        }
    </script>
</body>
</html>